#include <vcl.h>
#pragma hdrstop
USEPACKAGE("EIC.bpi");
USEPACKAGE("EICbtrv.bpi");
USEPACKAGE("Outils.bpi");
USEPACKAGE("CtrlStd.bpi");
USERES("CtrlDB.dcr");
USERC("Version.rc");
USEUNIT("CDBLkcb.cpp");
USEUNIT("CDBLklb.cpp");
USEUNIT("CDBRGrp.cpp");
USEUNIT("CDBChkb.cpp");
USEUNIT("CDBCombo.cpp");
USEUNIT("CDBListb.cpp");
USEUNIT("CDBMemo.cpp");
USEUNIT("CDBEdit.cpp");
USEUNIT("CDBGrid.cpp");
USEUNIT("CTable.cpp");
USEPACKAGE("vcl50.bpi");
USEPACKAGE("vclx50.bpi");
USEPACKAGE("vcldb50.bpi");
USEPACKAGE("vclbde50.bpi");
USERC("CtrlDB.rc");
USEPACKAGE("vclib50.bpi");
USEUNIT("uBDETableOp.cpp");
//---------------------------------------------------------------------------
#pragma package(smart_init)
//---------------------------------------------------------------------------
//   Source du paquet.
//---------------------------------------------------------------------------
int WINAPI DllEntryPoint(HINSTANCE hinst, unsigned long reason, void*)
{
    return 1;
}
//---------------------------------------------------------------------------
#ifdef _DEBUG
#include "ctrldb.h"
#include <IBQuery.hpp>
#include <IBTable.hpp>
#include <IBCustomDataset.hpp>
void VerifieDesallocComposantsFB( const TIBDatabase* db)
{
  try{
#pragma warn -8037
    if( db->DefaultTransaction->SQLObjectCount > 0)
    {
      int i = 0;
      while(true)
      {
        TIBBase *b = db->DefaultTransaction->SQLObjects[i++];
#pragma warn .8037
        if( b)
        {
          TIBQuery* q = dynamic_cast<TIBQuery*>(b->Owner);
          TIBSQL* s = dynamic_cast<TIBSQL*>(b->Owner);
          TIBTable* t = dynamic_cast<TIBTable*>(b->Owner);
          TIBDataSet* d = dynamic_cast<TIBDataSet*>(b->Owner);
          if( q)
          	ShowMessage( "Un composant TIBQuery n'a pas été désalloué\n" +
          							q->Name + "\n" +
          							q->SQL->Text);
          else if( s)
          	ShowMessage( "Un composant TIBSQL n'a pas été désalloué\n" +
          							s->Name + "\n" +
          							s->SQL->Text);
          else if( t)
          	ShowMessage( "Un composant TIBTable n'a pas été désalloué\n" +
          							t->Name);
          else if( d)
          	ShowMessage( "Un composant TIBDataSet (ou dérivé) n'a pas été désalloué\n" +
          							t->Name);
          else
          	ShowMessage( "Un composant Firebird ("+b->ClassName()+") n'a pas été désalloué");
        }
      }
    }
  }catch(...){}
}
#endif
